let list = {}
let methods = {}

const requireApi = require.context('./', false, /[A-Za-z]\w+\.js$/)
requireApi.keys().forEach(fileName => {
  // 排除index.js
  if (fileName.indexOf('index.js') < 0) {
    const apiConfig = requireApi(fileName).default

    list = Object.assign({}, list, apiConfig.list)
    methods = Object.assign({}, methods, apiConfig.methods)
  }
})

export const apiList = list
export const apiMethods = methods
